package working;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

public class RoundRobinTest extends TestCase {
	List<Robin> items = new ArrayList<Robin>();
	RoundRobin round;

	public void testOne() {
		items.add(new Robin(1));
		round = new RoundRobin(items);
		assertEquals(1, round.next());
		assertEquals(1, round.next());
	}

	public void testTwo() {
		items.add(new Robin(1));
		items.add(new Robin(2));
		round = new RoundRobin(items);
		assertEquals(1, round.next());
		assertEquals(2, round.next());
		assertEquals(1, round.next());
		assertEquals(2, round.next());
	}

	public void testThree() {
		items.add(new Robin(1));
		items.add(new Robin(2));
		items.add(new Robin(3));
		round = new RoundRobin(items);
		assertEquals(1, round.next());
		assertEquals(2, round.next());
		assertEquals(3, round.next());
		assertEquals(1, round.next());
		assertEquals(2, round.next());
		assertEquals(3, round.next());
	}
}